cmake_minimum_required(VERSION 3.8)
project(my_webots_sim)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(webots_ros2_driver REQUIRED)
find_package(webots_ros2_control REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(pluginlib REQUIRED)

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  # the following line skips the linter which checks for copyrights
  # comment the line when a copyright and license is added to all source files
  set(ament_cmake_copyright_FOUND TRUE)
  # the following line skips cpplint (only works in a git repo)
  # comment the line when this package is in a git repo and when
  # a copyright and license is added to all source files
  set(ament_cmake_cpplint_FOUND TRUE)
  ament_lint_auto_find_test_dependencies()
endif()

# Install launch files
install(DIRECTORY
  launch
  DESTINATION share/${PROJECT_NAME}
)

# Install config files
install(DIRECTORY
  config
  DESTINATION share/${PROJECT_NAME}
)

# Install worlds
install(DIRECTORY
  worlds
  DESTINATION share/${PROJECT_NAME}
)

# Install URDF
install(DIRECTORY
  urdf
  DESTINATION share/${PROJECT_NAME}
)

# # 添加驱动程序库
# add_library(
#   ${PROJECT_NAME}_driver
#   SHARED
#   src/MyRobotDriver.cpp
# )

# target_include_directories(
#   ${PROJECT_NAME}_driver
#   PRIVATE
#   include
# )

# ament_target_dependencies(
#   ${PROJECT_NAME}_driver
#   rclcpp
#   webots_ros2_driver
#   geometry_msgs
#   nav_msgs
#   pluginlib
# )

# # Generate plugin description file
# pluginlib_export_plugin_description_file(webots_ros2_driver plugins.xml)

# install(TARGETS
#   ${PROJECT_NAME}_driver
#   ARCHIVE DESTINATION lib
#   LIBRARY DESTINATION lib
#   RUNTIME DESTINATION bin
# )

# # Install plugin description file
# install(FILES
#   plugins.xml
#   DESTINATION share/${PROJECT_NAME}
# )

ament_package()


